function outputNum(){
    const arr = [1,2,3]
    arr.reduce((p,x)=>{
        return p.then(()=>{
            r =>{
                setTimeout(()=>r(console.log(x)),1000)
            }
        })
    },Promise.resolve())
    return arr
}
outputNum().then(function(data){
    console.log(data)
})



console.log(arr)